/**
 * Created with CLion.
 * Description: 
 * User: loong
 * Date: 2025/4/24
 * Time: 22:56
 */

#ifndef ACTOR_H
#define ACTOR_H

#include "ObjectWorld.h"

class Stats;
class Actor : public ObjectWorld
{
public:
    glm::vec2 GetVelocity() const { return velocity_; }
    void      SetVelocity(const glm::vec2 & _velocity) { velocity_ = _velocity; }

    float GetMaxSpeed() const { return max_speed_; }
    void  SetMaxSpeed(float _max_speed) { max_speed_ = _max_speed; }

    Stats * GetStats() const { return stats_; }
    void    SetStats(Stats * stats) { stats_ = stats; }

    void Move(float _dt);

    void TakeDamage(float _damage) override;

    bool IsAlive() const;

protected:
    glm::vec2 velocity_  = glm::vec2(0, 0);// 速度
    float     max_speed_ = 100.0f;         // 最大速度大小

    Stats * stats_ {nullptr};// 角色属性
};

#endif//ACTOR_H
